class UsersController < ApplicationController
  # Be sure to include AuthenticationSystem in Application Controller instead
  layout "error"
  # render new.rhtml
  def new
  end

  def create
    cookies.delete :auth_token
    reset_session
    @user = User.new(params[:user])
    @user.subdomain = URI.escape(@user.login).gsub('%', '').downcase if @user.valid?
    @user.subdomain = @user.subdomain + Time.now.to_f.to_s.gsub('.', '') if not User.find_by_subdomain(@user.subdomain).nil?
    @user.save!
    self.current_user = @user
    redirect_back_or_default('/')
    flash[:notice] = "Thanks for signing up!"
  rescue ActiveRecord::RecordInvalid
    render :action => "new"
  end
  
  def send_message
    
  end

end
